import request from '@/router/axios'
import { baseUrl } from '@/config/env'

export function fetchList(query) {
    return request({
        url: '/supplier/attendance/page',
        method: 'get',
        params: query
    })
}

export function addObj(obj) {
    return request({
        url: '/supplier/attendance/',
        method: 'post',
        data: obj
    })
}

export function getObj(id) {
    return request({
        url: '/supplier/attendance/' + id,
        method: 'get'
    })
}

export function delObj(id) {
    return request({
        url: '/supplier/attendance/' + id,
        method: 'delete'
    })
}

export function putObj(obj) {
    return request({
        url: '/supplier/attendance',
        method: 'put',
        data: obj
    })
}

export function casObj() {
    return request({
        url: '/supplier/attendance/cas',
        method: 'get'
    })
}

export function remoteData(query) {
    return request({
        url: '/supplier/attendance/remoteData',
        method: 'get',
        params: query
    })
}

export function exportObj(query) {
  return request({
    url: '/supplier/attendance/export',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}

const uploadExcel = baseUrl+ '/supplier/attendance/import'
export { uploadExcel }
